package com.pearadmin.pro.common.web.domain;

/**
 * Describe: Ajax 响应类型
 * Author: 就 眠 仪 式
 * CreateTime: 2019/10/23
 * */
public enum ResultCode {

    SUCCESS(200, "成功"),
    FAILURE(500, "失败"),
    LOGIN_SUCCESS(200, "登录成功"),
    LOGIN_FAILURE(500, "登录失败"),
    LOGOUT_SUCCESS(200,"注销成功"),
    NOT_LOGIN(401,"未登录"),
    NOT_PERMISSION(403, "未授权"),
    PARAMETER_ILLEGAL(2001, "参数不合法"),
    TOKEN_INVALID(2002, "无效的 Token"),
    TOKEN_SIGNATURE_INVALID(2003, "无效的签名"),
    TOKEN_EXPIRED(2004, "Token 过期"),
    TOKEN_MISSION(2005, "Token 缺失"),
    REFRESH_TOKEN_INVALID(2006, "刷新 Token 无效");

    /**
     * 标识
     * */
    private int code;

    /**
     * 消息
     * */
    private String message;

    /**
     * 构 造 方 法
     * */
    ResultCode(int code,String message){
        this.code = code;
        this.message = message;
    }

    /**
     * 获 取 标 识
     * */
    public int getCode(){
        return code;
    }

    /**
     * 获 取 消 息
     * */
    public String getMessage(){
        return message;
    }

}
